package com.xnyzc.lhy.common.penum.pay;

public enum EFeeType {

    startFee(0, "起步价"),
    mileageFee(1, "里程费"),
    durationFee(2, "时长费"),
    distanceFee(3, "远途费"),
    bridge(4, "路桥费"),
    parking(5, "停车费"),
    high(6, "高速费"),
    other(7, "其他费用"),
    total(8, "总费用");

    private Integer type;
    private String value;

    EFeeType(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static EFeeType findById(Integer type) {
        EFeeType ePaymentType;
        switch (type) {
            case 0:
                ePaymentType = EFeeType.startFee;
                break;
            case 1:
                ePaymentType = EFeeType.mileageFee;
                break;
            case 2:
                ePaymentType = EFeeType.durationFee;
                break;
            case 3:
                ePaymentType = EFeeType.distanceFee;
                break;
            case 4:
                ePaymentType = EFeeType.bridge;
                break;
            case 5:
                ePaymentType = EFeeType.parking;
                break;
            case 6:
                ePaymentType = EFeeType.high;
                break;
            case 7:
                ePaymentType = EFeeType.other;
                break;
            case 8:
                ePaymentType = EFeeType.total;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return ePaymentType;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }
}
